function Get-ResourceGroup {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $false)][string]$ResourceGroup,
        [Parameter(Mandatory = $false)][bool]$ConfirmAll = $false
    )

    # Allow user to use existing value or to update it.
    if ((Confirm-SingleValue -Description 'Azure resource group' -Value $ResourceGroup -ConfirmAll $ConfirmAll) -eq $true) { return $ResourceGroup }

    # Get resource groups from Azure.
    $resourceGroups = Get-AzResourceGroup

    # Ask user.
    Write-Host # Newline.
    $params = @{
        Question = 'Select which resource group you want to use:'
        Options = $resourceGroups.ResourceGroupName
    }
    $ResourceGroup = Open-LSQuestion @params

    return $ResourceGroup
}